package controller;

import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import vo.AjaxResult;

/**
 * Author：汤小洋
 * Date：2023-09-21 17:17
 * Description：<描述>
 */
@RestController
public class UploadController {

    @SneakyThrows
    @PostMapping("/upload")
    public AjaxResult upload(String name,@RequestParam CommonsMultipartFile file){
        System.out.println(name);
        System.out.println(file.getOriginalFilename()); // 文件名
        System.out.println(file.getSize()); // 文件大小
        System.out.println(file.getInputStream()); // 文件的输入流
        return AjaxResult.success();
    }

}
